package panel.sunTime
{
	import assists.HtmlText;
	import assists.SizeManager;
	import assists.TextFieldUtils;
	import assists.resource.ResourceLoader;
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.text.TextField;
	
	public class SunTimePicItem extends Sprite
	{
		private var _stage:Stage;
		private var _loader:ResourceLoader;
		private var _descTxt:TextField = new TextField();
		private var _pic:Bitmap;
		public function SunTimePicItem(stage:Stage,loader:ResourceLoader)
		{
			_stage = stage;
			_loader = loader;
			
			_descTxt.mouseEnabled = false;
			_descTxt.wordWrap = true;
			_descTxt.multiline = true;
		}
		
		public function show(data:Object):void
		{
			_pic = data.pic;
			TextFieldUtils.setHtmlText(_descTxt,HtmlText.formatSizeColor(data.desc,0xffffff));
			
			SizeManager.changeSizeFromWid(_pic,_stage.stageWidth * 0.9);
			_pic.x = _stage.stageWidth * 0.05;
			_descTxt.width = _pic.width;
			_descTxt.height = _pic.height * 0.3;
			_descTxt.x = _pic.x;
			_descTxt.y = _pic.height;
			this.addChild(_pic);
			this.addChild(_descTxt);
		}
		
	}
}